const express = require('express')
const router = express.Router()
const dishController = require('../controllers/dishController')

/**
 * 菜品分页条件查询
 * POST /dishes
 */
router.post('/', dishController.getAllDishes)

/**
 * 菜品详情查询
 * GET /dishes/:id
 */
router.get('/:id', dishController.getDishById)

/**
 * 创建菜品
 * POST /dishes/createDish
 */
router.post('/createDish', dishController.createDish)

/**
 * 更新菜品
 * PUT /dishes/:id
 */
router.put('/:id', dishController.updateDish)

/**
 * 删除菜品
 * DELETE /dishes/:id
 */
router.delete('/:id', dishController.deleteDish)

module.exports = router
